package com.job.shuang.HomeWork0702;

import java.util.SortedMap;

/**
 * @author
 * @version 1.0
 * @since 2022-07-02 20:51:02
 */
public class MyTool0702 {
    public static void main(String[] args) {
        int[] arr = {20, 22, 7, 2, 41, 35};
        for (int t = 0; t < arr.length - 1; t++) {//排序次数，外循环
            for (int i = 0; i < arr.length - 1 - t; i++) {//内循环减去排好的
                if (arr[i] < arr[i + 1]) {//降序排序
                    int temp = arr[i];
                    arr[i] = arr[i + 1];
                    arr[i + 1] = temp;
                }
            }
        }
        for (int i : arr) {
            System.out.print(i + ",");//打印
        }
    }
}
